home *** CD-ROM | disk | FTP | other *** search
/ Mastering Internet Develo…oft ActiveX Technologies / Mastering Internet Development with ActiveX (1996)(Microsoft).iso / labs / lab06 / formdump / keys.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  2.9 KB  |  106 lines

  1. // keys.h - header file for reusable interface
  2.  
  3. // Abstracted pointer
  4. typedef void * HKEYLIST;
  5.  
  6. //
  7. // Retrieves and decodes inbound form data.  Builds list of keys, and
  8. // pointers to data within a content file.  Returns handle to first
  9. // element in the list.
  10. //
  11.  
  12. HKEYLIST GetKeyList (EXTENSION_CONTROL_BLOCK *pECB);
  13.  
  14. //
  15. // GetKeyInfo extracts the key name and content values from the
  16. // supplied key, and returns a handle to the next key in the list.
  17. //
  18. // The length is the exact length of the inbound data, but a NULL
  19. // is appended to the data.  For example, a text string of five
  20. // characters has a *pdwLength=5, but GetKeyBuffer returns at
  21. // least a 6 byte buffer--the five characters and a NULL.
  22. //
  23.  
  24. HKEYLIST GetKeyInfo (HKEYLIST hKey, LPCTSTR *plpszKeyName, 
  25.                      LPDWORD pdwLength, BOOL *pbHasCtrlChars,
  26.                      LPINT pnInstance);
  27.  
  28. //
  29. // GetKeyBuffer returns a pointer to the buffer holding data.
  30. // Depending on the implementation in keys.cpp, this may or may not
  31. // be a buffer the exact size of the data (it may be bigger).
  32. //
  33. // The data is zero-terminated.
  34. //
  35.  
  36. LPBYTE GetKeyBuffer (HKEYLIST hKey);
  37.  
  38.  
  39. //
  40. // FindKey sequentially searches the linked list for a specific key.
  41. // The return handle can be used with GetKeyInfo to get more details.
  42. // FindKey returns the very first occurance of a duplicate key.
  43. // Also, it searches from the given key which need not be the head
  44. // key.
  45. //
  46.  
  47. HKEYLIST FindKey (HKEYLIST hKeyList, LPCTSTR lpszSearchName);
  48.  
  49.  
  50. //
  51. // FreeKeyList releases all of the memory associated with a key list.
  52. // Also, content resources are deleted.
  53. //
  54.  
  55. void FreeKeyList (HKEYLIST hKeyList);
  56.  
  57.  
  58. //
  59. // GetKeyOffset returns the offset within the internal buffer or
  60. // the content file.  Under normal circumstances, use GetKeyInfo
  61. // and GetKeyBuffer instead of directly accessing the buffer.
  62. //
  63.  
  64. DWORD GetKeyOffset (HKEYLIST hKey);
  65.  
  66.  
  67. #ifdef USE_TEMPORARY_FILES
  68. //
  69. // GetContentFile returns the name of the temporary file used
  70. // to save the content.  The temporary file may be open.
  71. //
  72.  
  73. LPCTSTR GetContentFile (HKEYLIST hKeyList);
  74.  
  75. //
  76. // CloseContentFile forces the content file to be closed.  This
  77. // allows you to pass the file to something else that may open
  78. // it.  Call OpenContentFile before calling any other key
  79. // function.
  80. //
  81.  
  82. void CloseContentFile (HKEYLIST hKeyList);
  83.  
  84.  
  85. //
  86. // OpenContentFile forces the content file to be reopened.
  87. // GetKeyBuffer will fail if the content file was closed by
  88. // CloseContentFile, but not reopened.
  89. //
  90.  
  91. void OpenContentFile (HKEYLIST hKeyList);
  92.  
  93. #else
  94.  
  95. //
  96. // GetDataBuffer returns a pointer to the start of the data
  97. // buffer which holds all content.  This function is not
  98. // particularly useful -- use GetKeyBuffer to get a pointer
  99. // to the buffer for a specific key.
  100. //
  101.  
  102. LPBYTE GetDataBuffer (HKEYLIST hKey);
  103.  
  104. #endif
  105.  
  106.